<?php

abstract class AbstractController extends Zend_Controller_Action {

	public function init (  ) {


	}

	protected function noLayoutForAjax (  ) {

		$this->_helper->layout->disableLayout();

	}

	protected function noDesignForAjax (  ) {

		$this->_helper->viewRenderer->setNoRender(true);
		self::noLayoutForAjax();
	}


	protected function addJsFile ( $url = '' ) {

		$this->view->headScript()->appendFile($url);
	}

	protected function addCssFile ( $url = '' ) {

		$this->view->headLink()->appendStylesheet($url);
	}

	protected function getFilesProject (  ) {

		$dir = APPLICATION_PATH . '/schemas/tables/';

		$tablesDir = opendir($dir) or die('Erreur');
		$files = array();
		while($file = @readdir($tablesDir)) {
			if($file != '.' && $file != '..' && !preg_match('/.php/', $file)) {
				$files[] = $file;
			}
		}
		closedir($tablesDir);

		$this->view->files = $files;
	}
}

